<template>
  <div>
    <el-button type="primary" @click="Add">添加</el-button>
    <list-vue @willEdit="willEdit"></list-vue>
    <form-vue :info="info" ref="form"></form-vue>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import listVue from "./components/list.vue";
import formVue from "./components/form.vue";
export default {
  components: {
    listVue,
    formVue,
  },
  props: [],
  data() {
    return {
      info: {
        isShow: false,
        isAdd: true,
      },
    };
  },
  computed: {
    ...mapGetters({}),
  },
  mounted() {},
  methods: {
    ...mapActions({}),
    Add() {
      this.info = {
        isShow: true,
        isAdd: true,
      };
    },
    willEdit(id) {
        this.info.isAdd=false;
        this.info.isShow=true;
        this.$refs.form.getOne(id)
    },
  },
};
</script>
<style scoped lang="less">
@import "../../less/index.less";
</style>